package main

import (
	"encoding/json"
	"fmt"
	"os"
)

func main() {
	var windowui *WindowUi

	windowui, _, err := ParseUi("./ui-test/position.ui")
	if err != nil {
		panic(err)
	}

	// to json格式化输出
	json_data, _ := json.MarshalIndent(windowui, "", "  ")
	//fmt.Println(string(json_data))
	// 写入json文件
	file, err := os.Create("./test-data/position.json")
	if err != nil {
		panic(err)
	}
	defer file.Close()
	file.Write(json_data)
	file.Sync()
	fmt.Println("write json success")

}
